home *** CD-ROM | disk | FTP | other *** search
/ boe.pres.k12.wv.us / boe.pres.k12.wv.us.zip / boe.pres.k12.wv.us / Utilities / Xerox Workcentre 5335 / Windows Utilities / Font Management Utility / ChineseS / Xerox Font Management Utility.msi / Data1.cab / fmu.chm3 / skinsupport / madcapbodyend.js < prev    next >
Text File  |  2011-04-21  |  4KB  |  145 lines

  1. // {{MadCap}} //////////////////////////////////////////////////////////////////
  2. // Copyright: MadCap Software, Inc - www.madcapsoftware.com ////////////////////
  3. ////////////////////////////////////////////////////////////////////////////////
  4. // <version>6.1.0.0</version>
  5. ////////////////////////////////////////////////////////////////////////////////
  6.  
  7. function FMCCheckForBookmarkInternal( a )
  8. {
  9.     var hrefPrefix  = FMCGetHref( document.location );
  10.     var href        = FMCEscapeHref( a.href );
  11.     
  12.     if ( href.substring( 0, hrefPrefix.length ) != hrefPrefix )
  13.     {
  14.         return;
  15.     }
  16.     
  17.     var hash        = a.href.substring( a.href.lastIndexOf( "#" ) + 1 );
  18.     var bookmark    = null;
  19.     
  20.     for ( var i = 0; i < document.anchors.length; i++ )
  21.     {
  22.         var currAnchor  = document.anchors[i];
  23.         
  24.         if ( currAnchor.name == hash )
  25.         {
  26.             bookmark = currAnchor;
  27.             
  28.             break;
  29.         }
  30.     }
  31.     
  32.     if ( bookmark && typeof( FMCUnhide ) == "function" )
  33.     {
  34.         FMCUnhide( window, bookmark );
  35.     }
  36. }
  37.  
  38. function FMCClickHandler( e )
  39. {
  40.     var target  = null;
  41.     
  42.     if ( !e )
  43.     {
  44.         e = window.event;
  45.     }
  46.     
  47.     if ( e.srcElement )
  48.     {
  49.         target = e.srcElement;
  50.     }
  51.     else if ( e.target )
  52.     {
  53.         target = e.target;
  54.     }
  55.     
  56.     (target.nodeName == "A") ? FMCCheckForBookmarkInternal( target ) : false;
  57.     
  58.     //
  59.     
  60.     if ( typeof( gJustPopped ) == "undefined" )
  61.     {
  62.         return;
  63.     }
  64.     
  65.     if ( !gJustPopped && gPopupObj && gPopupObj.style.display != "none" )
  66.     {
  67.         if ( typeof( FMCContainsClassRoot ) == "function" && FMCContainsClassRoot( gPopupObj.className, "MCKLinkBody" ) )
  68.         {
  69.             gPopupObj.parentNode.removeChild( gPopupObj );
  70.             gPopupBGObj.parentNode.removeChild( gPopupBGObj );
  71.         }
  72.         else
  73.         {
  74.             if ( gImgNode && typeof( FMCImageSwap ) == "function"  )
  75.             {
  76.                 FMCImageSwap( gImgNode, "swap" );
  77.                 gImgNode = null;
  78.             }
  79.             
  80.             // Reset fading
  81.             
  82.             if ( gPopupObj.filters )
  83.             {
  84.                 gPopupObj.style.filter = "alpha( opacity = 0 )";
  85.                 
  86.                 if ( gPopupBGObj != null )
  87.                 {
  88.                     gPopupBGObj.style.filter = "alpha( opacity = 0 )";
  89.                 }
  90.             }
  91.             else if ( gPopupObj.style.MozOpacity != null )
  92.             {
  93.                 gPopupObj.style.MozOpacity = "0.0";
  94.                 
  95.                 if ( gPopupBGObj != null )
  96.                 {
  97.                     gPopupBGObj.style.MozOpacity = "0.0";
  98.                 }
  99.             }
  100.             
  101.             //
  102.  
  103.             gPopupObj.style.display = "none";
  104.             
  105.             if ( gPopupBGObj != null )
  106.             {
  107.                 gPopupBGObj.parentNode.removeChild( gPopupBGObj );
  108.             }
  109.         }
  110.         
  111.         if ( gFadeID != 0 )
  112.         {
  113.             clearInterval( gFadeID );
  114.         }
  115.         
  116.         gPopupObj = null;
  117.         gPopupBGObj = null;
  118.         gFadeID = 0;
  119.         
  120.         if ( gTextPopupBody )
  121.         {
  122.             gTextPopupBody = null;
  123.             gTextPopupBodyBG = null;
  124.             window.onresize = null;
  125.         }
  126.     }
  127.     
  128.     gJustPopped = false;
  129. }
  130.  
  131. var gDocumentOnclickFunction    = document.onclick;
  132. var gDocumentOnclickFuncs        = new Array();
  133.  
  134. document.onclick = function( e )
  135. {
  136.     gDocumentOnclickFunction ? gDocumentOnclickFunction() : false;
  137.     
  138.     for ( var i = 0; i < gDocumentOnclickFuncs.length; i++ )
  139.     {
  140.         gDocumentOnclickFuncs[i]( e );
  141.     }
  142. };
  143.  
  144. gDocumentOnclickFuncs.push( FMCClickHandler );
  145.